package com.blog.blogservice.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.List;


@JsonInclude(value = JsonInclude.Include.NON_NULL)
@TableName(value = "article")
public class Article extends AdminClass {
    private static final long serialVersionUID = -43249773361209027L;

    public static final String FIELD_ARTICLE_ID = "articleId";
    public static final String FIELD_ARTICLE_CODE = "articleCode";
    public static final String FIELD_CATEGORY_ID = "categoryId";
    public static final String FIELD_LABEL_ID = "labelId";
    public static final String FIELD_ARTICLE_COVER = "articleCover";
    public static final String FIELD_ARTICLE_TITLE = "articleTitle";
    public static final String FIELD_ARTICLE_CONTENT = "articleContent";
    public static final String FIELD_VIDEO_URL = "videoUrl";
    public static final String FIELD_TIPS = "tips";
    public static final String FIELD_VIEW_STATUS = "viewStatus";
    public static final String FIELD_VIEW_COUNT = "viewCount";
    public static final String FIELD_LIKE_COUNT = "likeCount";


    public Article(Integer articleId, String articleCode, String categoryId, String labelId, String articleCover, String articleTitle, String articleContent, String videoUrl, String tips, Integer viewStatus, String viewCount, String likeCount, Integer deleted, String categoryName, String labelName) {
        this.articleId = articleId;
        this.articleCode = articleCode;
        this.categoryId = categoryId;
        this.labelId = labelId;
        this.articleCover = articleCover;
        this.articleTitle = articleTitle;
        this.articleContent = articleContent;
        this.videoUrl = videoUrl;
        this.tips = tips;
        this.viewStatus = viewStatus;
        this.viewCount = viewCount;
        this.likeCount = likeCount;
        this.deleted = deleted;
        this.categoryName = categoryName;
        this.labelName = labelName;
    }

    public Article() {
    }

    //    id
    @TableId(type = IdType.AUTO)
    private Integer articleId;
    private String articleCode;

    private String categoryId;

    //    标签id
    private String labelId;

    //    文章封面
    private String articleCover;

    //    文章标题
    private String articleTitle;

    //    文章内容
    private String articleContent;

    //    文章视频
    private String videoUrl;

    //    提示
    private String tips;

    //    是否可见
    private Integer viewStatus;

    //    浏览量
    private String viewCount;

    //    点赞数
    private String likeCount;

    @TableLogic(value = "0", delval = "1")
    private Integer deleted;

    @TableField(exist = false)
    private String categoryName;

    @TableField(exist = false)
    private String labelName;

    @TableField(exist = false)
    private List<Label> labelList;
    @TableField(exist = false)
    private List<Category> categoryList;


    @Override
    public String toString() {
        return "Article{" +
                "articleId=" + articleId +
                ", articleCode='" + articleCode + '\'' +
                ", articleTitle='" + articleTitle + '\'' +
                ", articleContent='" + articleContent + '\'' +
                ", labelList=" + labelList +
                ", categoryList=" + categoryList +
                '}';
    }

    public List<Label> getLabelList() {
        return labelList;
    }

    public void setLabelList(List<Label> labelList) {
        this.labelList = labelList;
    }

    public List<Category> getCategoryList() {
        return categoryList;
    }

    public void setCategoryList(List<Category> categoryList) {
        this.categoryList = categoryList;
    }

    public String getArticleCode() {
        return articleCode;
    }

    public void setArticleCode(String articleCode) {
        this.articleCode = articleCode;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public String getLabelName() {
        return labelName;
    }

    public void setLabelName(String labelName) {
        this.labelName = labelName;
    }

    public Integer getArticleId() {
        return articleId;
    }

    public void setArticleId(Integer articleId) {
        this.articleId = articleId;
    }

    public String getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(String categoryId) {
        this.categoryId = categoryId;
    }

    public String getLabelId() {
        return labelId;
    }

    public void setLabelId(String labelId) {
        this.labelId = labelId;
    }

    public String getArticleCover() {
        return articleCover;
    }

    public void setArticleCover(String articleCover) {
        this.articleCover = articleCover;
    }

    public String getArticleTitle() {
        return articleTitle;
    }

    public void setArticleTitle(String articleTitle) {
        this.articleTitle = articleTitle;
    }

    public String getArticleContent() {
        return articleContent;
    }

    public void setArticleContent(String articleContent) {
        this.articleContent = articleContent;
    }

    public String getVideoUrl() {
        return videoUrl;
    }

    public void setVideoUrl(String videoUrl) {
        this.videoUrl = videoUrl;
    }

    public String getTips() {
        return tips;
    }

    public void setTips(String tips) {
        this.tips = tips;
    }

    public Integer getViewStatus() {
        return viewStatus;
    }

    public void setViewStatus(Integer viewStatus) {
        this.viewStatus = viewStatus;
    }

    public String getViewCount() {
        return viewCount;
    }

    public void setViewCount(String viewCount) {
        this.viewCount = viewCount;
    }

    public String getLikeCount() {
        return likeCount;
    }

    public void setLikeCount(String likeCount) {
        this.likeCount = likeCount;
    }

    @Override
    public Integer getDeleted() {
        return deleted;
    }

    @Override
    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }
}

